<?

class Qi_Form_Field_Select extends Qi_Form_Field
{
	protected $tag = "select";
	protected $inline = false;
	public $type = null;
	private $_opcoes = array();

	public function __construct($opcoes = array(), $ini = array())
	{
		parent::__construct($ini);
		$this->_opcoes = $opcoes;
	}

	public function render()
	{
		return parent::render();
	}

	protected function gerar_conteudo_tag()
	{
		$htm = "\n";
		foreach($this->_opcoes as $value => $label):
			$value = h($value);
			$label = h($label);
			$selected = s($this->value, $value);
			$htm .= <<<OPT
	<option value="$value"$selected>$label</option>

OPT;
		endforeach;
		return $htm;
	}
}

?>